package ldh.im.admin.controller;

import ldh.im.admin.pojo.BigData;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.ArrayList;
import java.util.List;

@Controller
public class GigListController {

    @RequestMapping(method = RequestMethod.GET, value = "/list/bigList")
    public String main(Model model) throws Exception {
        List<BigData> list = new ArrayList();
        for (int i=0; i<1000; i++) {
            BigData bigData = new BigData();
            bigData.setId(i);
            int height = (int)(Math.random() * 80);
            height = height < 20 ? height + 20 : height;
            bigData.setHeight(height);
            bigData.setData("hello world " + i);
            list.add(bigData);
        }
        model.addAttribute("bigListDatas", list);
        return "list/bigList";
    }

}
